import 'package:flutter/material.dart';
import 'package:flutterdemo01/demo3/pages/FirstNewsListPage.dart';

class FirstNewsPage extends StatefulWidget {
  const FirstNewsPage({Key? key}) : super(key: key);

  @override
  _FirstNewsPageState createState() => _FirstNewsPageState();
}

class _FirstNewsPageState extends State<FirstNewsPage> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData(primaryColor: Colors.indigo),
      home: Scaffold(
          body: Column(
            children: [
              SizedBox(height: 100,),
              Container(
                width: 300,
                height: 300,
                color: Colors.purpleAccent,
                child: Text("新闻"),
              ),
              ElevatedButton(onPressed: () {
                Navigator.of(context).push(
                    MaterialPageRoute(builder:(context) {
                      return FirstNewsListPage(msg: '我是跳转的数据',);
                      // return FirstNewsListPage();
                    }
                    )
                );
              }, child: Text('新闻按钮'))
            ],
          )),
    );
  }
}
